package com.meng.mengiotmaster.utils;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;

import com.meng.mengiotmaster.module.main.ConnectionActivity;
import com.meng.mengiotmaster.module.main.Home2Activity;

/**
 * Create by：chenj on 2020/12/28 17:01
 * email：2355727644@qq.com
 */
public class UIHelper {


    public static void showConnection(Context context) {
        Intent intent = new Intent(context, ConnectionActivity.class);
        if (!(context instanceof Activity)) intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);
        ((Activity) context).overridePendingTransition(0, 0);
    }


    public static void showHome(Context context) {
        Intent intent = new Intent(context, HomeActivity.class);
        if (!(context instanceof Activity)) intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);
        ((Activity) context).overridePendingTransition(0, 0);
    }
    public static void show2Home(Context context) {
        Intent intent = new Intent(context, Home2Activity.class);
        if (!(context instanceof Activity)) intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
        context.startActivity(intent);
        ((Activity) context).overridePendingTransition(0, 0);
    }
}
